Skip to content

feat(docs): switch mobile-toc default from opt-in to opt-out#16685

Open
matlegault wants to merge 2 commits into
mainfrom
devin/1782317997-mobile-toc-opt-out
Open

feat(docs): switch mobile-toc default from opt-in to opt-out#16685
matlegault wants to merge 2 commits into
mainfrom
devin/1782317997-mobile-toc-opt-out

Conversation

@matlegault

@matlegault matlegault commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Description

Switch the mobileToc default from false (opt-in) to true (opt-out) so the mobile table of contents is enabled for all documentation sites by default. Users can still disable it by setting mobile-toc: false in their docs.yml.

Changes Made

  • parseDocsConfiguration.ts: mobileToc: layout.mobileToc ?? true (was ?? false)
  • docs.yml API definition: updated description to reflect opt-out behavior
  • LayoutConfig.ts SDK type: updated JSDoc comment
  • docs-yml.schema.json files: updated description text
  • Added unreleased changelog entry (feat)

Testing

  • Pre-commit hooks pass
  • Manual verification of affected code paths

Link to Devin session: https://app.devin.ai/sessions/dc05e99eb0c8464e85d2bf949350adf1
Requested by: @matlegault


Open in Devin Review

Change the default value of mobileToc from false to true so the mobile
table of contents is enabled for all documentation sites by default.
Users can still disable it by setting mobile-toc: false in docs.yml.

Also updates the docs.yml API definition description to reflect the
new opt-out behavior.

Co-Authored-By: mathieu <mathieu@buildwithfern.com>
@matlegault matlegault self-assigned this Jun 24, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Minimal layout path omits mobileToc, creating inconsistency with the new default

When layout == null but theme tabs properties are set, convertLayoutConfig returns a minimal layout object at packages/cli/configuration-loader/src/docs-yml/parseDocsConfiguration.ts:634-637 that does NOT include mobileToc. This means mobileToc will be undefined in the returned object. Previously, undefined and the old default false were semantically equivalent (both falsy). With the new default of true, there's a potential inconsistency: configs that specify a layout: section get mobileToc: true, while configs that only set theme tabs (no layout) get mobileToc: undefined. Whether this matters depends on how the downstream consumer (the Fern docs platform) treats undefined for this field — if it defaults to false, users without a layout: section won't get the mobile TOC. The same pattern exists for disableHeader, hideNavLinks, and hideFeedback, so this is a pre-existing architectural pattern rather than a new bug, but it's worth verifying the consumer-side default was also updated.

(Refers to lines 632-637)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The consumer-side default was updated in the companion PR (fern-platform#12578). Both readonly-docs-loader.ts and ledger-docs-loader.ts now use config.layout?.mobileToc ?? true, so when mobileToc is undefined (from either no layout section or an explicit layout without the field), it correctly defaults to true. This is the same pre-existing pattern used by disableHeader, hideNavLinks, and hideFeedback.

@github-actions

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-06-24T05:18:39Z).

Fixture main PR Delta
docs 222.2s (n=5) 223.7s (35 versions) +1.5s (+0.7%)

Docs generation runs fern generate --docs --preview end-to-end against the benchmark fixture with 35 API versions (each version: markdown processing + OpenAPI-to-IR + FDR upload).
Delta is computed against the nightly baseline on main.
Baseline from nightly run(s) on main (latest: 2026-06-24T05:18:39Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-06-24 17:05 UTC

@github-actions

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-06-24T05:18:39Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 76s (n=5) 109s (n=5) 63s -13s (-17.1%)
go-sdk square 134s (n=5) 283s (n=5) 132s -2s (-1.5%)
java-sdk square 214s (n=5) 285s (n=5) 193s -21s (-9.8%)
php-sdk square 59s (n=5) 85s (n=5) 55s -4s (-6.8%)
python-sdk square 130s (n=5) 241s (n=5) 130s +0s (+0.0%)
ruby-sdk-v2 square 92s (n=5) 129s (n=5) 85s -7s (-7.6%)
rust-sdk square 183s (n=5) 174s (n=5) 155s -28s (-15.3%)
swift-sdk square 57s (n=5) 431s (n=5) 51s -6s (-10.5%)
ts-sdk square 236s (n=5) 239s (n=5) 224s -12s (-5.1%)

main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-06-24T05:18:39Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-06-24 17:07 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant